package cn.glinks.liuhe.activity;

import android.os.Bundle;
import android.widget.TextView;

import butterknife.BindView;
import butterknife.OnClick;
import cn.glinks.liuhe.R;
import cn.glinks.liuhe.api.jsonbean.TestResult;
import cn.glinks.liuhe.app.AppApplication;
import cn.glinks.liuhe.app.AppManager;
import cn.glinks.liuhe.base.BaseActivity;


/**
 * Des:测评结果页面
 *
 * @author MarsBlade of Cyh
 * @created 2017-03-21 14:43
 */
public class TestResultActivity extends BaseActivity {

    @BindView(R.id.tv_comment)
    TextView mCommentText;

    @BindView(R.id.tv_advice)
    TextView mAdviceText;

    // 变量
    private TestResult mTestResult = null;// 当前测评结果缓存信息

    @Override
    public int getLayoutId() {
        return R.layout.activity_test_result;
    }

    @Override
    public void initView(Bundle savedInstanceState) {
        // 设置为透明状态栏
        SetTranslanteBar();
        // 获取测评结果缓存
        mTestResult = ((AppApplication)getApplicationContext()).getTestResult();
        if (mTestResult != null) {
            mCommentText.setText(mTestResult.getComment());
            mAdviceText.setText(mTestResult.getAdvice());
        } else {
            mCommentText.setText("没有结果");
            mAdviceText.setText("没有结果");
        }
    }

    /*--------------------------------------------------------------------------------
     *                          点击事件接口实现
     ---------------------------------------------------------------------------------*/
    // 退出测评
    @OnClick(R.id.btn_exit)
    public void clickExitApp() {
        //退出测评软件
        AppManager.getAppManager().AppExit(this, false);
    }

}
